/*
 * @Copyright: Copyright (c) 2030 吴周海
 * @Author: wzh200x@126.com
 * @Date: 2025-10-09 14:48:48
 * @LastEditors: wzh200x@126.com
 * @LastEditTime: 2025-10-09 14:49:08
 * @FilePath: \goWebServer\goGameWebServer\internal\register\database_register.go
 * @Description: 文件功能描述
 */
package register

import (
	"context"
	"goGameWebServer/internal/common/config"
	"goGameWebServer/internal/interfaces"
)

var databaseRegister = make(
	map[string]func(ctx context.Context, option config.DatabaseOption) (
		interfaces.IDataBase, error))

func RegisterDatabase(name string, createFunc func(ctx context.Context, option config.DatabaseOption) (
	interfaces.IDataBase, error)) {
	databaseRegister[name] = createFunc
}

func GetDatabaseCreateFunc(name string) func(ctx context.Context, option config.DatabaseOption) (
	interfaces.IDataBase, error) {
	return databaseRegister[name]
}
